package mysql

import (
	"github.com/astaxie/beego/orm"
	"time"
)

type WifidetectorigData struct {
	Id              int       `orm:"Column(ID)"`
	ZoneId          int       `orm:"Column(ZoneID)"`
	DateTime        time.Time `orm:"Column(DateTime)"`
	Date            string    `orm:"Column(Date)"`
	Ipaddr          string    `orm:"Column(Ipaddr)"`
	MacDetected     string    `orm:"Column(MacDetected)"`
	Enter           int       `orm:"Column(Enter)"`
	Rssi            int       `orm:"Column(Rssi)"`
	Type            int       `orm:"Column(type)"`
	Macorganization string    `orm:"Column(macorganization)"`
}

func (w *WifidetectorigData) TableName() string {
	return WifiDetectorigTBName()
}

func FindWifiByDate(date string) (*[]WifidetectorigData, error) {
	o := orm.NewOrm()
	data := new([]WifidetectorigData)
	_, err := o.Raw("SELECT * FROM T_wifidetectorigdata WHERE Date = ?", date).QueryRows(data)
	return data, err
}
